package lock2;

public class MyLockReetant2Demo {
	private MyReetantLock2 lock2 = new MyReetantLock2();
	public static void main(String[] args) {
		MyLockReetant2Demo myLock2Demo = new MyLockReetant2Demo();
		myLock2Demo.main();
	}
	
	public void main() {
		System.out.println("main is in....");
		lock2.lock();
		System.out.println("main is doing....");
		sub();
		lock2.unLock();
		System.out.println("main is out....");
	}
	
	public void sub() {
		System.out.println("sub is in....");
		lock2.lock();
		System.out.println("sub is doing....");
		lock2.unLock();
		System.out.println("sub is out....");
	}
}
